package Test;

import java.util.ArrayList;
import java.util.List;

public class Student implements Comparable<Student> {
    private Integer stuNo;
    private String name;
    private Integer num;

    public Student(Integer stuNo) {
        this.stuNo = stuNo;
        List<String> list = new ArrayList<String>();
        num = (int) (Math.random() * 40 + 60);
        String[] firstname = {"张", "王", "李", "赵", "刘", "孙"};
        String[] lastname = {"三", "四", "五", "流", "榫"};
        name = firstname[(int) (Math.random() * firstname.length)] + lastname[(int) (Math.random() * lastname.length)];
    }

    public Integer getStuNo() {
        return stuNo;
    }

    public void setStuNo(Integer stuNo) {
        this.stuNo = stuNo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public int compareTo(Student o) {
        int zg = o.getNum();
        int me = this.getNum();
        return zg - me;
    }

    public String toString() {
        return "Student [stuNo=" + stuNo + ", name=" + name + ", num=" + num + "]";
    }
}